package com.bytecodezz.app.photoshop.loader.base

import android.graphics.Bitmap
import android.graphics.drawable.Drawable
import android.widget.ImageView
import com.bytecodezz.app.photoshop.loader.listener.BitmapLoaderListener
import com.bytecodezz.app.photoshop.loader.listener.DrawableLoaderListener
import com.bytecodezz.app.photoshop.loader.listener.FileLoaderListener

/**
 * 图片加载模板接口，定义各种参数配置的方法，并且提供泛型作为方法的返回值类型
 */
interface IPhotoshopLoaderTemplate<T> {

    fun asBitmap(): T
    fun asDrawable(): T
    fun asFile(): T
    fun asGif(): T
    fun downloadOnly(): T

    fun addListener(listener: BitmapLoaderListener): T
    fun addListener(listener: FileLoaderListener): T
    fun addListener(listener: DrawableLoaderListener): T

    fun error(bitmap: Bitmap): T
    fun error(drawable: Drawable): T
    fun error(resourceId: Int): T

    fun preload(width: Int, height: Int): T

    fun into(imageView: ImageView)
    fun into()


}